﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YTSK.Frm
{
    public partial class FrmSKFPList : Form
    {

        public Frm.FrmSKFPListBase report;

        public FrmSKFPList()
        {
            try
            {
                InitializeComponent();
                this.Icon = YTSK.Properties.Resources.Fly;
                report = new Frm.FrmSKFPListBase(this.groupBox2, this.dataGridView1,
                    "v_sk_salebill", this.toolStrip1);
                report.InitControl();
                this.btQuery.Click += report.GetGridData;
                this.Resize += frmMain_Resize;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }



        #region 全选
        private bool _bSel = true;
        private void SelectAll(object sender, EventArgs e)
        {
            var dg = this.dataGridView1;
            for (int i = 0; i < dg.Rows.Count; i++)
            {
                var row = dg.Rows[i];
                row.Cells["selcol"].Value = _bSel ? "√" : (row.Index + 1).ToString();
            }
            _bSel = !_bSel;
        }

        #endregion

        #region 窗体大小
        private void frmMain_Resize(object sender, EventArgs e)
        {
            if (this.Width > 20)
            { this.dataGridView1.Width = this.Width - 20; }
            if (this.Height > 200)
            {
                this.dataGridView1.Height = this.Height - 200;
            }
        }
        #endregion

        private void toolStripButton11_Click(object sender, EventArgs e)
        {
            var f = new FrmVouch();
            f.Show(this);
        }
    }
}
